package exception;

import java.awt.*;
import java.io.IOException;

//子类重写超类还有throws声明异常抛出的方法时,对throws的重写规则
public class ThrowsDemo {
    public void dosome()throws IOException,AWTException{}
}
class SubClass extends ThrowsDemo{
    //允许
//    public void dosome() {} //不抛异常
//    public void dosome()throws IOException{}//只抛部分异常
//    public void dosome()throws  FileNotFoundException {}//抛子类异常
//    public void dosome()throws IOException,AWTException {}//复制
//    public void dosome()throws IOException,AWTException, FileNotFoundException {}//多抛子类

    //不允许
//    public void dosome()throws Exception {}//抛父类
//    public void dosome()throws SQLException {}//抛其他类

}
